package com.tuanbiao.controllers;

import androidx.annotation.NonNull;

import com.hzjq.data.entity.PlanEntity;
import com.tuanbiao.base.mvp.IModel;
import com.tuanbiao.base.mvp.IPresenter;
import com.tuanbiao.base.mvp.IView;
import com.tuanbiao.models.action.BleBusAction;
import com.tuanbiao.models.action.CheckAction;
import com.tuanbiao.models.action.DelayAction;
import com.tuanbiao.models.action.DetonatorAction;
import com.tuanbiao.models.action.LocationAction;
import com.tuanbiao.models.action.PlanAction;
import com.tuanbiao.models.action.SettingAction;

import java.util.List;

/**
 * @author abiao
 * @since 2022/4/11 14:46
 */
public interface PlanController {
    interface Model extends IModel, PlanAction, DetonatorAction, DelayAction, CheckAction, LocationAction, SettingAction, BleBusAction {

    }

    interface SettingView extends IView {
        void showDefaultDelay(String startDelay, String rowDelay, String columnDelay);

        void showKeyDelay(String f1Delay, String f2Delay);
    }

    interface SettingPresenter extends IPresenter {
        void setDelay(String startDelay, String rowDelay, String columnDelay, String f1Delay, String f2Delay);

        long getMaxDelay();
    }

    interface View extends IView {
        void refresh();

        void refreshFailed(String msg);

        void setPlantItems(List<PlanEntity> planList);

        void onPlanChange(PlanEntity plan);

        void onPlanDelete(PlanEntity plan);

        void onPlanSelectChange(boolean select);

        void startDetonatorRegister(PlanEntity plan);

        void showStatistic(int planCount, int detonatorCount, int noAuthDetonatorCount);

        void startAuthOnline(PlanEntity plan);

        void startBlast();

        void showCheckDialog();

        void hideCheckDialog();
    }

    interface Presenter extends IPresenter {
        void refresh();

        void getPlanList();

        void refreshPlanList();

        void insert(PlanEntity plan);

        void update(PlanEntity plan);

        void select(boolean select);

        void delete(PlanEntity plan);

        void delete(List<PlanEntity> plans);

        void auth(PlanEntity plan);

        void merge(String name, List<PlanEntity> plans);

        void startDetonatorRegister(PlanEntity plan);

        void startBlast();

        void share(@NonNull PlanEntity plan);
    }
}
